﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using VietThinks.Model;

namespace VietThinks.Mapping.Maps
{
    public class ProductMap : ImmutableDomainEntityMap<Product>
    {
        public ProductMap()
        {
            Schema("Product");
            Table("Product");
            Id(x => x.Id);
            Map(x => x.Code);
            Map(x => x.Name);
            Map(x=>x.Price);
            References(m => m.Manufacturer, "ManId");
            References(m => m.Classification, "ClassificationId");
            Map(x => x.Detail);
            Map(x => x.Description);
            Map(x => x.IsAvailable);
            Map(x => x.CreatedDate);
            Map(x => x.ModifiedDate);
            //HasManyToMany(x => x.StoresStockedIn)
            //  .Cascade.All()
            //  .Inverse()
            //  .Table("StoreProduct");
        }    
    }
}
